package com.stars.entity.mygenerate;
/**
 * Created by luodajie on 2019/1/6.
 */

import com.stars.common.WheterYN;
import com.stars.common.base.BaseUUID;
import com.stars.common.date.DateUtil;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

/**
 * @author :dj
 * @version : 1.0.0
 * @description
 * @Date 2019-01-06 17:03
 * @note
 */
@Data
@Table(name = "cg_form_field")
public class CgFormField extends BaseUUID {
    /**
     * 字段名称
     */
    @NotBlank(message = "字段名称不能为空！")
    @Column(name = "FILED_NAME")
    private String name;
    /**
     * 字段描述
     */
    @NotBlank(message = "字段描述不能为空！")
    @Column(name = "FILED_CONTENT")
    private String text;
    /**
     * 长度
     */
    @Column(name = "FILED_LENGTH")
    private Integer length = 255;
    /**
     * 是否必填
     */
    @Column(name = "FILED_MUST_INPUT")
    private String notEmpty = WheterYN.NO.getValue();
    /**
     * 是否查询
     */
    @Column(name = "IS_QUERY")
    private String isQuery = WheterYN.NO.getValue();
    /**
     * 查询条件（普通查询，范围查询）
     */
    private String operate;
    /**
     * 是否显示
     */
    @Column(name = "IS_SHOW")
    private String isShow = WheterYN.YES.getValue();
    /**
     * 是否是key
     */
    @Column(name = "IS_KEY")
    private String isKey = WheterYN.NO.getValue();
    /**
     * 数据库字段类型
     */
    @NotBlank(message = "数据库字段类型不能为空")
    @Column(name = "FILED_TYPE")
    private String type = "string";
    /**
     * 表id
     */
    @Column(name = "TABLE_ID")
    private String tableId;
    /**
     * 创建时间
     */
    @Column(name = "CREATE_DATE")
    private Long createDate = DateUtil.getNewTime();
    /**
     * 更新时间
     */
    @Column(name = "UPDATE_DATE")
    private Long updateDate;
    /**
     * 字符排序
     */
    @Column(name = "FILED_ORDER")
    private Integer filedOrder;

    @Column(name = "IS_EXPORT")
    private String isExport = WheterYN.NO.getValue();
    /**
     *字典表
     */
    @Column(name = "DICT_TABLE")
    private String dictTable;
    /**
     *字典代码
     */
    @Column(name = "DICT_CODE")
    private String dictCode;
    /**
     *字典显示名称
     */
    @Column(name = "DICT_TEXT")
    private String dictText;
    /**
     *字典Source
     */
    @Column(name = "DICT_SOURCE")
    private String dictSource;
    /**
     * 校验规则
     */
    @Column(name = "FIELD_VALID_TYPE")
    private String fieldValidType;
}
